package com.nbsaas.boot.manufacturing.rest.resource;

import com.nbsaas.boot.manufacturing.api.apis.ProcessStepApi;
import com.nbsaas.boot.manufacturing.data.entity.ProcessStep;
import com.nbsaas.boot.manufacturing.api.domain.request.ProcessStepRequest;
import com.nbsaas.boot.manufacturing.api.domain.response.ProcessStepResponse;
import com.nbsaas.boot.manufacturing.api.domain.simple.ProcessStepSimple;
import com.nbsaas.boot.manufacturing.rest.convert.ProcessStepSimpleConvert;
import com.nbsaas.boot.manufacturing.rest.convert.ProcessStepEntityConvert;
import com.nbsaas.boot.manufacturing.rest.convert.ProcessStepResponseConvert;
import com.nbsaas.boot.manufacturing.data.repository.ProcessStepRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   工艺步骤-业务接口实现
*/
@Transactional
@Service
public class ProcessStepResource extends BaseResource<ProcessStep,ProcessStepResponse, ProcessStepSimple, ProcessStepRequest>  implements ProcessStepApi {

    @Resource
    private ProcessStepRepository processStepRepository;

    @Override
    public JpaRepositoryImplementation<ProcessStep, Serializable> getJpaRepository() {
        return processStepRepository;
    }

    @Override
    public Function<ProcessStep, ProcessStepSimple> getConvertSimple() {
        return new ProcessStepSimpleConvert();
    }

    @Override
    public Function<ProcessStepRequest, ProcessStep> getConvertForm() {
        return new ProcessStepEntityConvert();
    }

    @Override
    public Function<ProcessStep, ProcessStepResponse> getConvertResponse() {
        return new ProcessStepResponseConvert();
    }




}


